package com.aispace.taichu.modules.dynamic.model.controller;

import com.aispace.taichu.modules.controller.BaseController;
import com.aispace.taichu.modules.dynamic.model.model.entity.ModelConfig;
import com.aispace.taichu.modules.dynamic.model.service.IModelConfigService;
import com.aispace.taichu.response.ResponseResult;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@AllArgsConstructor
@RequestMapping("/models")
public class ModelController  extends BaseController<IModelConfigService, ModelConfig> {

    private final IModelConfigService modelConfigService;

    /**
     * 设置默认模型
     * @param modelId
     * @return {@link Boolean}
     */
    @PostMapping("/set-default/{id}")
    public ResponseResult<Boolean> setDefault(@PathVariable("id") Long modelId) {
        return ResponseResult.success(modelConfigService.setDefault(modelId));
    }


}
